from nicegui import ui, app
import userlogin
# from niceguiToolkit.layout import inject_layout_tool
# inject_layout_tool()


def withCick():
    ui.notify('登录成功')

def main():
    app.add_static_files(local_directory="assets", url_path="/assets")

    ui.query(".nicegui-content").classes("bg-[url('/assets/login-bg.jpg')] bg-cover h-screen")


    with ui.card().classes("backdrop-blur-sm bg-white/30 p-10 w-[40%] gap-4 absolute-center items-center"):
        ui.label("login_user登陆").style("font-size:2.2rem").classes("text-h4")
        username = ui.input("用户名称").style("font-size:1.1rem")
        password = ui.input("密码", password=True, password_toggle_button=True)

        ui.button("登陆",on_click=withCick)


    # with ui.card().classes(""):
    #     ui.label("另一个卡片").classes("text-h4")

main()
ui.run()